<?php
class user_password extends spController{
	function index(){
		echo '<form action='.spUrl('user_password','submit').' method=POST>';
		echo '用户名或邮箱：<input type=text name=username>';
		echo '旧密码：<input type=password name=oldpassword>';
		echo '新密码：<input type=password name=newpassword>';
		echo '<input type=submit name=submit>';
		echo '</form>';
	}
	
	function submit(){
		$result = spClass('libICase') -> acl_user_password($this->spArgs('username'),$this->spArgs('oldpassword'),$this->spArgs('newpassword'));
		if($result == '-1'){
			echo '旧密码不正确';
		}
		elseif($result === TRUE){
			echo '修改成功';
		}
	}
}